package battleGame;

import java.util.List;


public abstract class AStarNode implements Comparable {

  AStarNode pathParent;
  double costFromStart;
  double estimatedCostToGoal;
  int id;
  String label;
  boolean isEmpty;
  
  public double getCost() {
    return costFromStart + estimatedCostToGoal;
  }


  public int compareTo(Object other) {
    double thisValue = this.getCost();
    double otherValue = ((AStarNode)other).getCost();

    double v = thisValue - otherValue;
    return (v>0)?1:(v<0)?-1:0; // sign function
  }


  /**
    Gets the cost between this node and the specified
    adjacent ) node.
  */
  public abstract double getCost(AStarNode node);


  /**
    Gets the estimated cost between this node and the
    specified node. 
  */
  public abstract double getEstimatedCost(AStarNode node);

  
}  